from multiprocessing import Process
import os

filename = '报名照片.jpg'

size = os.path.getsize(filename)


def top():
    f = open(filename, 'rb')
    n = size // 2
    fw = open('top.jpg', 'wb')
    fw.write(f.read(n))
    f.close()
    fw.close()


def bot():
    f = open(filename, 'rb')
    fw = open('bot.jpg', 'wb')
    f.seek(size // 2, 0)
    while True:
        data = f.read(1024)
        if not data:
            break
        fw.write(data)
    f.close()
    fw.close()


if __name__ == "__main__":
    t = Process(target=top)
    b = Process(target=bot)
    t.start()
    b.start()
    t.join()
    b.join()
